package com.nightpiter.model.exceptions;

/**
 * BindingBuilderException class. superclass for exceptions thrown when there is
 * no element in the xml with the specified id attribute.
 * 
 * @author Eldar Abusalimov (eldar.abusalimov@gmail.com)
 */
@SuppressWarnings("serial")
public class BindingBuilderException extends BuilderException {
	/**
	 * standard error message
	 */
	private static final String MESSAGE = "Error binding objects by element's id attr";

	/**
	 * constructor without arguments
	 */
	public BindingBuilderException() {
		super(MESSAGE);
	}

	/**
	 * @param detailMessage
	 */
	public BindingBuilderException(String detailMessage) {
		super(MESSAGE + " : " + detailMessage);
	}

	/**
	 * @param throwable
	 */
	public BindingBuilderException(Throwable throwable) {
		super(throwable);
	}

	/**
	 * @param detailMessage
	 * @param throwable
	 */
	public BindingBuilderException(String detailMessage, Throwable throwable) {
		super(MESSAGE + " : " + detailMessage, throwable);
	}

	/**
	 * @param id
	 * @param refAttribute
	 * @param refElement
	 * @param refId
	 */
	public BindingBuilderException(String message, int id, String refAttribute,
			String refElement) {
		super(MESSAGE + " : " + message + " : " + id
				+ "(referring attribute \"" + refAttribute + "\" of element \""
				+ refElement + "\")");
	}

}
